﻿using Abp.Application.Services;
using Abp.Domain.Repositories;
using Abp.Linq.Extensions;
using AbpVueDemo.Employee;
using AbpVueDemo.EmployeeManager.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbpVueDemo.EmployeeManager
{
    public class Employees_regService : AsyncCrudAppService<Employee_regplus, Employee_regInputDto,
         int, PageEmployee_regRequestDto, Employee_regCreateDto, Employee_regUpdateDto>, IEmployee_regService
    {
        public Employees_regService(
      IRepository<Employee_regplus, int> repository) : base(repository)
        {

        }

        protected override IQueryable<Employee_regplus> CreateFilteredQuery(PageEmployee_regRequestDto input)
        {
            return base.CreateFilteredQuery(input)
                .WhereIf(!string.IsNullOrEmpty(input.e_name), c => c.e_name.Contains(input.e_name))
                .WhereIf(!string.IsNullOrEmpty(input.e_phone), c => c.e_phone.Contains(input.e_phone));
        }


    }
}
